﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using VideoCache.Server.MVCWeb.Attributes;

namespace VideoCache.Server.MVCWeb.Areas.Admin.Models
{
    public class UserModel
    {
        [Display(Name = "用户账号")]
        public int Id { get; set; }

        [Required]
        [Display(Name = "用户名")]
        [Remote("IsUserNameAvaliable", "User", "Admin", ErrorMessage = "用户名已经存在！", HttpMethod = "POST", AdditionalFields = "Id")]
        public string UserName { get; set; }

        [Required]
        [Display(Name = "密码")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [Required]
        [Display(Name = "电子邮件")]
        [Email(ErrorMessage = "请输入正确的邮箱格式")]
        [Remote("IsEmailAvaliable", "User", "Admin", ErrorMessage = "电子邮件已经存在！", HttpMethod = "POST", AdditionalFields = "Id")]
        public string Email { get; set; }

        [Required]
        [Display(Name = "手机号码")]
        public string MobilePhone { get; set; }

    }
}